{extend name="public/admin_public"} {block name="content"}
<div class="mdui-m-a-1 mdui-typo mdui-table-fluid">
    <form>
        <h1 class="mdui-m-l-3">Topic 管理</h1>
        <table class="mdui-table mdui-textfield">
            <thead>
                <tr>
                    <th>#</th>
                    <th>标题</th>
                    <th>内容</th>
                    <th>浏览数</th>
                    <th>评论数</th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                {volist name="topicData" id="vo"}
                <tr>
                    <td>{$vo.tid}</td>
                    <td>{$vo.subject}</td>
                    <td>{$vo.content|raw|strip_tags}</td>
                    <td>{$vo.views}</td>
                    <td>{$vo.comment}</td>
                    <td>
                        <div class="mdui-btn-group">
                            <a href="">
                                <button type="button" class="mdui-btn">
                                    <i class="mdui-icon material-icons">create</i>
                                    编辑
                                </button>
                            </a>
                            <a href="">
                                <button type="button" class="mdui-btn">
                                    <i class="mdui-icon material-icons">delete</i>
                                    删除
                                </button>
                            </a>
                        </div>
                    </td>
                </tr>
                {/volist}
            </tbody>
        </table>

    </form>
</div>

{/block} {block name="js"}
<script>
    var $$ = mdui.JQ,
        data = '';;

    $$('#forum').addClass('mdui-collapse-item-open');
    $$('#setTopic').addClass('mdui-list-item-active');

    $$('#submit').on('click', function () {
        data = $$('form').serialize();

        $$.ajax({
            method: 'post',
            url: '',
            data: data,
            dataType: 'json',
            success: function (res) {
                if (res.code == 0) {
                    mdui.snackbar(res.message, {
                        timeout: 2000,
                        position: 'top'
                    })
                } else {
                    mdui.snackbar(res.message, {
                        timeout: 2000,
                        position: 'top'
                    })
                }

            }
        })

        return false;
    })
</script> {/block}